
page.page = 0;
page.pageSize = 10;
page.type = '';
(function() {
  jftype();
  jflist();
  /**
   * 可兑换列表
   */
  $('body').on('click','.uExch',function(){
    page.page = 0;
    page.pageSize = 10;
    page.type = '';
    jfexlist('unExchange');
  });
  /**
   * 已兑换
   */
  $('body').on('click','.wExch',function(){
    page.page = 0;
    page.pageSize = 10;
    page.type = '';
    jfexlist('exchange');
  });
})();
/**
 * 积分信息查询
 */
function jftype(){
  getJson(Domain+'/mbr/doSearchMemberPoints.do',{

  },function(res){
    //console.log(res);
    $('#avapoints').html(res.data.mbrPoints.availPoints);
  });
}
/**
 * 会员积分列表明细
 */
function jflist(){
  getJson(Domain+'/mbr/doSearchPointsList.do',{
    page:page.page+1,
    pageSize:page.pageSize,
    type:''
  },function(res){
    //console.log(res);
    $('#pointlist').empty();
    renderTmp('#pointlist', 'pointlisttpl', res);
  });
}
/**
 * 积分可以兑换列表
 */
function jfexlist(typea){
  getJson(Domain+'/mbr/doSearchPointExchangeList.do',{
    type:'unExchange',
    page:page.page+1,
    pageSize:page.pageSize
  },function(res){
    console.log(res);
    if(typea == 'unExchange'){
      $('#epointlist').empty();
      renderTmp('#epointlist', 'exchlisttpl', res);
    }else{
      $('#upointlist').empty();
      renderTmp('#upointlist', 'uexchlisttpl', res);
    }
  });
}